<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
<meta content="" name="pgv">
<title>{$systeminfo['shopname']}</title>
<link href="./source/modules/eorder/template/css/footer.css" rel="stylesheet" type="text/css">
<link href="./source/modules/eorder/template/css/base.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="./source/modules/eorder/template/css/card.css" media="all">
<link href="./source/modules/eorder/template/css/wap.css" rel="stylesheet" type="text/css">
<link href="./source/modules/eorder/template/css/myOrder.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./source/modules/eorder/template/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="./source/modules/eorder/template/js/jscommon.js"></script>
</head>
<body>
  <div id = "first">
  <div id = "second" style="margin-top:10px">
    <div class="cardexplain" style="margin:0">
      <ul class="round ">
        
          <li class="">
            <table width="100%" border="0" cellspacing="0" cellpadding="0"
              class="kuang">
              <tbody>
                <tr>
                  <td width="66%"> 
                    <form action = "javascript:;"    method = "POST">
                      <input name = "bind_sn_coupon1"  type  = "hidden"  value = "输入优惠码"  class="coupon-btn"/>
                        <input name = "bind_sn_coupon" type = "text"  placeholder="输入优惠码"  class="px"  id = "coupon_sn" style="border:0;padding:10px 0"/>
                    </form>
                  </td>
                  <td>
                    <div class="footReturn">
                      <a id="showcard" class=" coupon-btn" href="javascript:void(0)" >兑换</a>
                    </div>
                  </td>
                </tr>
              </tbody>
            </table>
          </li>
      </ul>
      
     </div>
  </div>
  	{if empty($myCoupons)}
   	  		<div class=" empty_Coupons cardexplain no-coupon" >无可用的优惠券</div>
   	 {else}
   	 {loop $myCoupons $coupon}
   	 	<div class=" empty_Coupons cardexplain coupon" >{$coupon['title']} 抵{$coupon['money']} 元 <br> 有效期：{$coupon['start_date']}-{$coupon['end_date']}</div>
   	 {/loop}
   	 {/if}
  	<!--结束 $coupon_list-->
  </div>
  <div id="codFloat" style="display:none" class="cod" style="height:60px">
    <div class="wx_mask"></div>
      <div class="wx_confirm ">
        <div class="wx_confirm_inner" id="wx_confirm_float">
          <div class="wx_confirm_hd">
            <div class="wx_confirm_tit" id = "show_mes">123</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <footer>
  <div class="fix-bottom"></div>
    <div class="bottomBox">
        <div class="indexMsg">
        <div class="indexMsg">
            <div class="indexMenu">
                	<a href="{php echo $this->createMobileUrl('index', array())}"><span class=" home-index">首页</span></a>
                	<a href="{php echo $this->createMobileUrl('ordering', array('openid' => $item['id']))}"><span class=" Order-index">订单</span></a>
                	<a href="{php echo $this->createMobileUrl('usercenter', array('openid' => $item['id']))}"><span class="card-index-active">我的</span></a>
              </div>
        </div>
        </div>
    </div>
</footer>
 <script>
 	$(document).ready(
 		function (){
 			$("#showcard").click(
 				function(){
 					var submitData = {
 							bind_sn_coupon : $("#coupon_sn").val().trim()
 						};
 					if($("#coupon_sn").val().trim() == ""){
 						alert_1("请输入优惠码");
 						return false;
 					}
          
 					$.post("/",submitData,
 						function (data){
 							if(data.message.state == 1){
 								alertToUrl(data.message.msg,
 										"/");
 							}else{
 								alert_1(data.message.msg);
 							}
 					},"json")
 				});
 			});
 	$("#windowclosebutton").click(function() {
		$("#windowcenter").slideUp(500);

	});
	$("#alertclose").click(function() {
		$("#windowcenter").slideUp(500);
	});
  function hide_res(){
    $("#codFloat").hide();
  }
  function show_res(){
    setTimeout("hide_res()",2000);
  }
	function alert_1(title) {
		$("#show_mes").html(title);
    $("#codFloat").show();
    show_res();
	}

	function alertToUrl(title, url) {  
    alert_1(title);
    setTimeout("window.location.href='" + url + "'", 500);
	}
 </script>
  </body>
  </html>
